@extends('layouts.admin')
@section('title') @parent 详情 @stop
@section('page_title')@parent
详情
@show
@section('breadcrumb')@parent
{{ Breadcrumbs::render('user-edit') }}
@show
@section('content')
<div class="row">
<div class="nav-tabs-custom" style="cursor: move;">
		<!-- Tabs within a box -->
		@include('widgets.notification')
		<ul class="nav nav-tabs pull-right ui-sortable-handle">
		<li class="active"><a data-toggle="tab" href="#tab-general">基本信息</a></li>
		@if($user->user_group_id==2)<li class=""><a data-toggle="tab" href="#tab-lawyer">律师资料@endif</a></li>
		<li class="pull-left header"><i class="fa fa-inbox"></i> 详情</li>
		</ul>
		<form name="frm_user" autocomplete="off" method="post" action="#">
		<input type="hidden" name="_token" value="{{ csrf_token() }}" />
		<div class="tab-content no-padding">
			 <div id="tab-general" class="tab-pane active">
					<div class="box box-primary">
							<div class="box-body">
									<div class="form-group">
												<label class="control-label" for="account">帐号</label> {{ $user->account }}
									</div>
									<div class="form-group">
												<label class="control-label" for="staff_name">姓名</label> {{ $user->realname ? $user->realname : $user->info->name; }}
									</div>
									<div class="form-group">
												<label class="control-label" for="staff_name">电话</label> {{ $user->phone }}
									</div>		
									<div class="form-group">
												<label class="control-label" for="staff_name">邮箱</label> {{ $user->email }}
									</div>
									<div class="form-group">
												<label class="control-label" for="staff_name">地址</label> {{ AreaHelper::areaCodeToName($user->province) }} {{ AreaHelper::areaCodeToName($user->city) }} {{ AreaHelper::areaCodeToName($user->district) }} {{ $user->address }}
									</div>	
							</div>
							<div class="box-footer">
									<a href="javascript:history.go(-1)" type="button" class="btn btn-default">返 回</a>
							</div>
					</div>
			 </div>
			 <div id="tab-lawyer" class="tab-pane">
					<div class="box box-primary">
							<div class="box-body"> 
									<div class="form-group">
												<label class="control-label" for="realname">律师状态</label> 
												{{ ($user->status == 3) ? '<strong class="text-green">已认证</strong>' : '<strong class="text-red">未认证</strong>';  }}
									</div>	
									<div class="form-group">
												<label class="control-label" for="realname">推荐律师</label> {{ $user->info->is_recommended ? '<strong class="text-green">已被推荐</strong>' : '<strong class="text-red">未被推荐</strong>';  }}
									</div>	
									<div class="form-group">
												<label class="control-label" for="license">头像</label> <img src="{{ Config::get('app.url').'/'.$user->avatar }}" style="width:100px; height:auto;" >
									</div>
									<div class="form-group">
												<label class="control-label" for="realname">真实姓名</label> {{ $user->realname }}
									</div>	
									<div class="form-group">
												<label class="control-label" for="license">律师证号</label> {{ $user->info->license }}
									</div>
									<div class="form-group">
												<label class="control-label" for="license">律师证</label> <img src="{{ Config::get('app.url').'/'.$user->info->license_file }}" style="width:100px; height:auto;" >
									</div>
									<div class="form-group">
												<label class="control-label" for="company_name">所在律所</label> {{ $user->info->company_name }}
									</div>
									<div class="form-group">
												<label class="control-label" for="position">职位</label> {{ $user->info->position }}
									</div>
									<div class="form-group">
												<label class="control-label" for="company_name">执业年限</label> {{ $user->info->practice_period }}
									</div>
									<div class="form-group">
												<label class="control-label" for="introduce">业务范围</label> {{ UtilsHelper::get_lawyer_work_scope($user->info->work_scope) }}
									</div>
									<div class="form-group">
												<label class="control-label" for="introduce">律师简介</label> {{ $user->info->introduce }}
									</div>
									<div class="form-group">
												<label class="control-label" for="introduce">工作经验</label> {{ $user->info->experience }}
									</div>
							</div>
							<div class="box-footer">
									<a href="{{ route('admin.users.index', $user->user_group_id) }}" type="button" class="btn btn-default">返 回</a>
									@if($user->status!=3)<a href="#" type="button" class="btn btn-primary btn-verify">认证通过</a>@endif
									@if(!$user->info->is_recommended)<a href="#" type="button" class="btn btn-primary btn-recommend">确定推荐</a>@endif
							</div>
					</div>
			 </div>
		</div>
		</form>
</div>
</div>

@stop
@section('end')
    @parent
<script>
$(function() {
		$(".btn-verify").click(function(){
			if(confirm("确认该律师通过认证？"))
			{
					location.href="{{ route('admin.users.verify', $user->id) }}";
			}
	  })
});

$(function() {
		$(".btn-recommend").click(function(){
			if(confirm("确推荐该律师？"))
			{
					location.href="{{ route('admin.users.recommend', $user->id) }}";
			}
	  })
});
</script>
@stop
